FROM public.ecr.aws/lambda/python:3.8
RUN yum -y update
RUN yum -y install git && yum clean all
RUN yum -y install tar gzip zlib freetype-devel \
    gcc \
    ghostscript \
    lcms2-devel \
    libffi-devel \
    libimagequant-devel \
    libjpeg-devel \
    libraqm-devel \
    libtiff-devel \
    libwebp-devel \
    make \
    openjpeg2-devel \
    rh-python36 \
    rh-python36-python-virtualenv \
    sudo \
    tcl-devel \
    tk-devel \
    tkinter \
    which \
    xorg-x11-server-Xvfb \
    zlib-devel \
    && yum clean all
RUN pip install -U --force-reinstall pillow-simd
RUN pip install requests

# Copy function code
COPY __init__.py ${LAMBDA_TASK_ROOT}/app.py
COPY 500.jpg ${LAMBDA_TASK_ROOT}/500.jpg

# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD [ "app.lambda_handler" ] 